package com.osdp.startup;

import com.osdp.common.listener.TokenContextListener;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

/**
 * java -jar target/micro-web-0.0.1-SNAPSHOT.jar
 * java -jar target/micro-web-0.0.1-SNAPSHOT.jar --server.port=9001
 * java -jar target/micro-web-0.0.1-SNAPSHOT.jar --server.port=9002
 *  EnableDiscoveryClient 服务发现，可支持其他的注册中心
 *  EnableEurekaClient 服务发现 支持Eureka注册中心
 * @author liubo
 *
 */

@SpringBootApplication(scanBasePackages = "com.osdp",exclude = {org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class})
@MapperScan("com.osdp.*.mapper")
//@EnableDiscoveryClient
public class MicroWebApplication {
	
	public static void main(String[] args) {
		SpringApplication.run(MicroWebApplication.class, args);
	}

	@Bean
	public TokenContextListener tokenContextListener(){
		return new TokenContextListener();
	}
}
